var xmlhttp
function refreshHaulers()
{
xmlhttp=GetXmlHttpObject();
 if (xmlhttp==null)
   {
   alert ("Your browser does not support AJAX!");
   return;
   }
 var url="refreshHaulers.php";
 xmlhttp.onreadystatechange=scHauler;
 xmlhttp.open("GET",url,true);
 xmlhttp.send(null);
}

function scHauler()
{
if (xmlhttp.readyState==4)
  {
  var my_array = eval(xmlhttp.responseText);
  var cmbObj = document.getElementById('cmbHauler');
  cmbObj.length = 0;
  
  //Create default --select-- option
  var x = document.createElement('option');
	
  x.text = "--Select--";
  x.value = -1;
  try
  {
	cmbObj.add(x,null); // standards compliant
  }
  catch(ex)
  {
    cmbObj.add(x); // IE only
  }
  
  var row;
  for (row = 0; row < my_array.length; row++)
  {
	var hauler = my_array[row][0];
	var id = my_array[row][1];
	var x = document.createElement('option');
	
	x.text = hauler;
	x.value = id;
	try
	{
		cmbObj.add(x,null); // standards compliant
	}
	catch(ex)
	{
	cmbObj.add(x); // IE only
	}
  }
  }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}